﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改密码</title>
<script src="js/jquery-1.5.2.min.js" type="text/javascript"></script>
<style>
*{ margin:0 auto; padding:0;}
html{ background-color:#4e84c0;}
.xgmm{
	width:460px;
	height:220px;
	margin-top:0px;
	background:url(images/xgmm.gif) no-repeat;
	padding-top: 80px;
}
.mm_ys{
	height:20px;
	width:180px;
}
.ymm{
	width:280px;
	height:20px;
	margin-top: 80px;
	font-size:14px;
}
.xmm{
	width:240px;
	height:20px;
	font-size:14px;
	margin-bottom: 10px;
}
.anniu{
	width:140px;
	float:right;
	margin-right:40px;
	margin-top: 5px;
}
.an{
	width:49px;
	height:18px;
	float:left;
	margin-left:20px;
	font-size:14px;
	text-align:center;
	background-image:url(images/an_1.gif);
	color: #FFF;
	line-height: 18px;
}
</style>
<script>
function doit() {
	if (($("#oldPass").val() == "") || ($("#newPass").val() == "") || ($("#newPass1").val() == "")) {
		alert("不能为空");
		return false;
	}
	
	if ($("#newPass").val() != $("#newPass1").val()) {
		alert("输入的两个新密码不一致");
		return false;
	}
	
	if ($("#newPass").val().length != 6) {
		alert("密码长度必须是6位");
		return false;
	}
	
	$.post("main", $("#form1").serialize(),function(data) {
		if (data.code == 0) {
			alert("密码修改成功");
			window.close();
		} else if (data.code == 1)
			alert("原密码不正确");
		else
			alert("操作失败，请咨询管理员");
		
	});
}
</script>
</head>

<body>
<div class="xgmm">
	<form id="form1">
  <div class="xmm">原密码：<input class="mm_ys" id="oldPass" name="oldPass" type="password"></div>
  <div class="xmm">新密码：<input class="mm_ys" id="newPass" name="newPass" type="password"></div>
  <div class="xmm">新密码：<input class="mm_ys" id="newPass1" name="newPass1" type="password"></div>
  <div class="anniu">
  	<div class="an"><a onclick="doit()">确定</a></div>
  	<div class="an"><a onClick="window.close()">取消</a></div>
  </div>
  <input type="hidden" id="action" name="action" value="17" />
  </form>
</div>
</body>
</html>
